Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier

Package Overview
Dependencies
Maintainers
11
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier

Prettier is an opinionated code formatter

  • 2.8.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
43M
increased by3.8%
Maintainers
11
Weekly downloads
 
Created

What is prettier?

Prettier is an opinionated code formatter that supports many languages and integrates with most editors. It removes all original styling and ensures that all outputted code conforms to a consistent style.

What are prettier's main functionalities?

Code Formatting

Formats all .js files in the src directory and its subdirectories. When run, this command will process each JavaScript file and reformat it according to Prettier's rules.

prettier --write 'src/**/*.js'

Configuration Overrides

Allows customization of Prettier's default formatting rules. For example, this JSON configuration disables semicolons at the end of statements and enforces single quotes.

{
  'semi': false,
  'singleQuote': true
}

Ignoring Code

You can prevent a section of code from being formatted by Prettier by adding a special comment, `// prettier-ignore`, before it.

// prettier-ignore
let untouched = 'This code will not be formatted by Prettier.';

Integration with Editors

Prettier can be integrated into many code editors to automatically format files on save or during editing, enhancing the developer's workflow.

N/A

Support for Multiple Languages

Prettier supports a wide range of languages and frameworks, including but not limited to JavaScript, TypeScript, CSS, HTML, and Markdown, making it a versatile tool for many developers.

N/A

Other packages similar to prettier

FAQs

Package last updated on 23 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc